package com.i2works.smartluolong.utils.ibeetl;

import org.beetl.core.Context;
import org.beetl.core.Function;

/**
 * 判断空
 *
 * @author koal <koal@vip.qq.com>
 * @date 2017/2/22 09:37
 */
public class NullFunction implements Function {
    @Override
    public Object call(Object[] paras, Context ctx) {
        {
            if (paras.length != 2)
            {
                throw new RuntimeException("参数错误，期望Object,Object");
            }
            if (null == paras[0])
            {
                return paras[1];
            }
            else
            {
                return paras[0];
            }

        }
    }

}
